package com.djx.user.controller;
import com.djx.common.domain.User;
import com.djx.common.result.Result;
import com.djx.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    /**
     * 查询用户的方法
     * @param user
     * @return
     */
    @PostMapping("/findUser")
    public Result<User> findUser(@RequestBody User user){
        Result<User> result=userService.findUser(user);
        return result;
    }
}
